package com.ebs.md.fxmonitor.marketmonitor.esper;

/**
 * Perforce Revision:
 *  $File: //depot/MarketData/fxmonitor/main/src/main/java/com/ebs/md/fxmonitor/marketmonitor/esper/PulseSingleBasicStatement.java $
 *  $Revision: #1 $  $Change: 115321 $  $DateTime: 2012/10/02 16:08:17 $  $Author: Arik.Sher $
 */

import com.ebs.md.container.esper.AbsStatement;
import com.ebs.md.fxmonitor.marketmonitor.config.IPulsingConfig;


public class PulseSingleBasicStatement
extends AbsStatement<IPulsingConfig>
{
	protected final static long esper_time_period_pulsing = 2;
	
	@Override
	protected String createEplExpression() {
		String str =
		String.format(eplExpressionText
				, config.getName()                   //1. configuration name.
				, esper_time_period_pulsing          //2. from  OBCRemove.win:ext_timed(timestamp, %dl seconds) as r
				, getRegion()                        //3. region
				, config.getPriceLevelThreshold()    //4. OBCRemove.obPosition <= %d
				, config.getLifeTimeThreshold()      //5. OBCRemove.entryLifeTime <= %dl
				, config.getNumberOfDealsThreshold() //6. %d - number of deal .
				, esper_time_period_pulsing          //7. from Deal.win:ext_timed(timestamp, %dl seconds) as deal
				);
		
		return str;
	}
	
}
